﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

//http://blog.andrew-veresov.com/?tag=/silverlight
namespace HasuSLUI
{
    public static class ValidationSummaryExtender
    {
       /* public static void AddError(this ValidationSummary summary, Control control, string message, string messageHeader)
        {
            ValidationSummaryItem vsi = summary.Errors.Where(vi => vi.Context == control).FirstOrDefault();
            if (vsi == null)
            {
                summary.Errors.Add(new ValidationSummaryItem(message, messageHeader,
                                                                       ValidationSummaryItemType.PropertyError,
                                                                       new ValidationSummaryItemSource("Text", control),
                                                                       control));
            }
            else
            {
                vsi.Message = message;
            }
        }

        public static void ClearError(this ValidationSummary summary, Control control)
        {
            ValidationSummaryItem vsi = summary.Errors.Where(vi => vi.Context == control).FirstOrDefault();
            if (vsi != null)
            {
                summary.Errors.Remove(vsi);
            }
        }
        */
    }
}
